<?php
class Members extends Controller {

	function Members(){
		parent::Controller();	
	}
	function index(){
		redirect('/members/show/');
	}
	function show(){
		$this->load->model('UsersDetail');
		$this->load->model('UserMahasiswa');
		$this->load->model('User');
		$data['theMembers'] = '';
		if($this->session->userdata('isLogin')){
			$data['namaLoggedIn'] = json_decode($this->UserMahasiswa->getNama($this->session->userdata('userId')))->nama;
		}
		if($users_id = $this->User->getAllUsers(0,10)){
			for ($i=0;$i<sizeof($users_id['id']);$i++){
				$user_id[$i] =  $users_id['id'][$i];
				$data['theMembers'] = $data['theMembers'].$this->_formatMembers($user_id[$i]);
			}
		}
		$data ['allMembers'] = $users_id;
		$data['pageTitle'] = "Members";
		$data['page']='allMembers';
		$users_id = $this->User->getAllUsers(0,99999999);
		$data['num_messages'] = sizeOf($users_id['id']);
		$this->load->view('members',$data);
	}
	function _formatMembers($users_id){
		$this->load->model('UsersDetail');
		$this->load->model('UserMahasiswa');
		$this->load->model('User');
		$detail = json_decode($this->UsersDetail->getDetail($users_id));
		if($detai